package com.distributedDataBase.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class Cart implements Serializable{

  private Integer id;
  private Integer productId;
  private String name;
  private Double price;
  private String imgUrl;
  private String remark;
  private Integer total;

  //后端返回给前端的json数据中包括日期类型
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
  //前端传过来的日期的格式需要和此处的pattern中配置的日期的模板要高度保持一致,否则抛出404
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createDate;
  private Integer userId;


}
